﻿
Option Compare Binary
Option Infer On
Option Strict On
Option Explicit On

Imports DC_RackSLDE
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.ComponentModel.DataAnnotations
Imports System.Data
Imports System.Linq
Imports System.ServiceModel.DomainServices.EntityFramework
Imports System.ServiceModel.DomainServices.Hosting
Imports System.ServiceModel.DomainServices.Server


'Implements application logic using the dc_rackEntities context.
' TODO: Add your application logic to these methods or in additional methods.
' TODO: Wire up authentication (Windows/ASP.NET Forms) and uncomment the following to disable anonymous access
' Also consider adding roles to restrict access as appropriate.

<EnableClientAccess()> _
Public Class tblAttrApplication_DCRackDomainService
    Inherits LinqToEntitiesDomainService(Of dc_rackEntities)

    'TODO:
    ' Consider constraining the results of your query method.  If you need additional input you can
    ' add parameters to this method or create additional query methods with different names.
    'To support paging you will need to add ordering to the 'tblAttrApplications' query.
    Public Function GetTblAttrApplications() As IQueryable(Of tblAttrApplication)
        ' the group/filter is appname
        Return Me.ObjectContext.tblAttrApplications.OrderBy(Function(e) e.appName)
    End Function

    <RequiresAuthentication()> _
    Public Sub InsertTblAttrApplication(ByVal tblAttrApplication As tblAttrApplication)
        If ((tblAttrApplication.EntityState = EntityState.Detached) _
                    = False) Then
            Me.ObjectContext.ObjectStateManager.ChangeObjectState(tblAttrApplication, EntityState.Added)
        Else
            Me.ObjectContext.tblAttrApplications.AddObject(tblAttrApplication)
        End If
    End Sub

    <RequiresAuthentication()> _
    Public Sub UpdateTblAttrApplication(ByVal currenttblAttrApplication As tblAttrApplication)
        Me.ObjectContext.tblAttrApplications.AttachAsModified(currenttblAttrApplication, Me.ChangeSet.GetOriginal(currenttblAttrApplication))
    End Sub

    <RequiresAuthentication()> _
    Public Sub DeleteTblAttrApplication(ByVal tblAttrApplication As tblAttrApplication)
        If (tblAttrApplication.EntityState = EntityState.Detached) Then
            Me.ObjectContext.tblAttrApplications.Attach(tblAttrApplication)
        End If
        Me.ObjectContext.tblAttrApplications.DeleteObject(tblAttrApplication)
    End Sub

End Class

